package lab02.test22;

public class Test {
    public static void main(String[] args) {
        //给定一个字符串，将字符串中的所有大写字母变成小写字母
        // 数字用0 来代替，其他符号用#代替
        String result="Hello, 2017 ,World!";
        //hello##0000##world#
        StringBuffer stringBuffer=new StringBuffer();

        for (int i=0;i<result.length();i++){
            char tmp=result.charAt(i);
            if (tmp>='A'&&tmp<='Z'){
               // System.out.print((char)(tmp+32));//强制转换int型为char
                stringBuffer.append(tmp);
            }else if (tmp>='a'&&tmp<='z'){
                //System.out.print(tmp);
                stringBuffer.append(tmp);
            }else if (tmp>='0'&&tmp<='9'){
                //System.out.print("0");
                stringBuffer.append("0");
            }else {
                //System.out.print("#");
                stringBuffer.append("#");
            }
        }
        System.out.println(stringBuffer.toString());
    }
}
